package com.spark.market.dal.repository.impl;

import com.spark.market.common.utils.AssertUtils;
import com.spark.market.dal.dao.OrderInfoDoMapper;
import com.spark.market.dal.dao.OrderLogDoMapper;
import com.spark.market.dal.entity.OrderInfoDo;
import com.spark.market.dal.entity.OrderLogDo;
import com.spark.market.dal.repository.OrderRepository;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

@Repository
public class OrderRepositoryImpl implements OrderRepository {
    @Resource
    private OrderInfoDoMapper orderInfoDoMapper;
    @Resource
    private OrderLogDoMapper orderLogDoMapper;
    @Override
    public void insertOrder(OrderInfoDo orderInfoDo) {
        AssertUtils.isNotNull(orderInfoDo, "orderInfoDo is null");
        orderInfoDoMapper.insertSelective(orderInfoDo);
    }

    @Override
    public void insertOrderLog(OrderLogDo orderLogDo) {
        AssertUtils.isNotNull(orderLogDo, "orderInfoDo is null");
        orderLogDoMapper.insertSelective(orderLogDo);
    }
}
